<?php
/* phpYahooSiteExplorer Class 1.0.0
 * Written by Jay Denis (jay@gotfoo.org)
 * Google Project Page: http://code.google.com/p/phpyahoo/
 * Released under GNU Lesser General Public License (http://www.gnu.org/copyleft/lgpl.html)
 * For more information about the class and upcoming tools and toys using it,
 * visit hhttp://phpYahoo.gotfoo.org or http://code.google.com/p/phpyahoo/
 *
 *     Please submit all issues to the project page:
 *         http://code.google.com/p/phpyahoo/issues/list
 * 
 
 */



class phpYahooSiteExplorer extends phpYahoo {
	

	var $base_url = 'http://search.yahooapis.com/SiteExplorerService/V1/';
	var $command_inlink = 'inlinkData';
	var $command_pagedata = 'pageData';
	var $command_update = 'updateNotification';
	
	function request_site_data ($url,$params)     {   
	    $xml = $this->request($url,$params);	    
		$results = array();
		$i = 0;
		foreach($xml->Result as $result){			
			$results[$i] = array("title"=>$result->Title,"url"=>$result->Url,"clickUrl"=>$result->ClickUrl);
			$i++;				
		}			
		return $results;
    } 
    
    function searchInlink($params){
		
   		$response =  $this->request_site_data($this->base_url.$this->command_inlink,$params);
       	return $response;
    }
    
    function searchPageData($params){		 		       
				
   		$response =  $this->request_site_data($this->base_url.$this->command_pagedata,$params);
       	return $response;
    }
    
    function updateNotification($url){		 		       
				  		
       	
       	$xml = $this->request($this->base_url.$this->command_update,$url);	    
		$results = array();
		$i = 0;
		foreach($xml->Success  as $result){			
			$results[$i] = array("message"=>$result->Message);
			$i++;				
		}	
		
		return $results;
    }
    
   
    
}
?>